<template>
  <div>
    <brack :params1="'权限管理'" :params2="'权限列表'"></brack>
   
    <el-card class="box-card">
      <!-- 表单区域 -->
      <template>
        <el-table :data="list" style="width: 100%" stripe border>
          <el-table-column type="index" label="#"> </el-table-column>
          <el-table-column prop="authName" label="权限名称" width="480">
          </el-table-column>
          <el-table-column prop="path" label="路径" width="480">
          </el-table-column>
          <el-table-column label="权限登记">
            <template slot-scope="scope">
          
              <el-tag v-if="scope.row.level == 0">一级</el-tag>
              <el-tag type="success" v-else-if="scope.row.level == 1"
                >二级</el-tag
              >
              <el-tag type="warning" v-else>三级</el-tag>
            </template>
          </el-table-column>
        </el-table>
      </template>
    </el-card>
  </div>
</template>

<script>
import { rights_api } from "@/api";
export default {
  data() {
    return {
      list: []
    };
  },
  created() {
    this.add();
  },
  methods: {
    async add() {
      const { data: res } = await rights_api("list");
      console.log(res);
      this.list = res.data;
    }
  }
};
</script>

<style scoped lang="less">
.box-card {
  margin-top: 20px;
}
</style>
